package com.authine.cloudpivot.ext.service.base;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient;

@Service
public class ZzdBaseServiceImpl {

    private static Logger log = LoggerFactory.getLogger(ZzdBaseServiceImpl.class);

    // 租户ID
    @Value("${syncorg.tenantId:12607}")
    public String tenantId;
    // @Value("${syncorg.dingtalkgov:dingtalkind}")
    // public String dingtalkgov;
    @Value("${syncorg.domainName}")
    public String domainName;
    @Value("${syncorg.protocal}")
    public String protocal;
    @Value("${syncorg.appKey}")
    public String appKey;
    @Value("${syncorg.appSecret}")
    public String appSecret;

    // // 消息跳转url
    // public static String OPENURL = "://dingtalkclient/page/link?url=";
    // // 侧边跳转
    // public static String RIGHT_REDIRECT = "&pc_slide=true";
    // // 工作台跳转,需放在url参数第一个位置
    // public static String TAB_REDIRECT = "?ddtab=true";
    //
    // public static String TASK_PACKAGE_UUID = "#";

    public ExecutableClient getExecutableClient(Map<String, String> params) {
        if (log.isDebugEnabled()) {
            log.debug("getExecutableClient params is, {}", params);
        }
        ExecutableClient executableClient = ExecutableClient.getInstance();
        executableClient.setAccessKey(appKey);
        executableClient.setSecretKey(appSecret);
        executableClient.setDomainName(domainName);
        executableClient.setProtocal(protocal);
        executableClient.init();
        return executableClient;
    }

}
